Skip to content

docs(js): Add docs for strictTraceContinuation and orgId #14459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 29, 2025

Conversation

s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented Jul 25, 2025

DESCRIBE YOUR PR

Docs for strictTraceContinuation and orgId (related PR).

I'm not 100% sure where I should put the orgId as it does not 100% fit into the "Tracing Options" section but it's currently only used for tracing.

closes getsentry/sentry-javascript#16308

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

Copy link

vercel bot commented Jul 25, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 29, 2025 9:19am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
develop-docs ⬜️ Ignored (Inspect) Visit Preview Jul 29, 2025 9:19am

Copy link

codecov bot commented Jul 25, 2025

Bundle Report

Changes will increase total bundle size by 10.75kB (0.05%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-client-array-push 9.83MB -6 bytes (-0.0%) ⬇️
sentry-docs-server-cjs 12.25MB 10.76kB (0.09%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: sentry-docs-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
static/chunks/pages/_app-*.js -3 bytes 879.71kB -0.0%
static/chunks/1831-*.js -3 bytes 422.23kB -0.0%
static/TWZY_3xasV4uN6CE4ovqv/_buildManifest.js (New) 684 bytes 684 bytes 100.0% 🚀
static/TWZY_3xasV4uN6CE4ovqv/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/-*.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️
static/-*.js (Deleted) -684 bytes 0 bytes -100.0% 🗑️
view changes for bundle: sentry-docs-server-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
1729.js -3 bytes 1.75MB -0.0%
../instrumentation.js -3 bytes 1.08MB -0.0%
9523.js -3 bytes 1.05MB -0.0%
../app/[[...path]]/page.js.nft.json 3.59kB 728.4kB 0.5%
../app/platform-redirect/page.js.nft.json 3.59kB 728.31kB 0.5%
../app/sitemap.xml/route.js.nft.json 3.59kB 725.79kB 0.5%

Comment on lines 396 to 403
<SdkOption name="orgId" type='`${number}` | number'>

The organization ID for your Sentry project.

The SDK will try to extract the organization ID from the DSN. If it cannot be found, or if you need to override it,
you can provide the ID with this option. The organization ID is used for trace propagation and for features like `strictTraceContinuation`.

</SdkOption>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As stated in the PR description: I am not 100% sure where we should put orgId in the options hierarchy.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine. Or move it below DSN.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree!
Here are my thoughts:
A more sustainable approach (for example, in the future, this ID could be used in other features?) might be to place it under "Core Options", under DSN. Then, to highlight that only specific features use this option, you could put the respective sentences ("The organization ID is used for ...") into an Alert (info). And then link orgId in the strictTraceContinuation option so users don't have to search for it.

Comment on lines 396 to 403
<SdkOption name="orgId" type='`${number}` | number'>

The organization ID for your Sentry project.

The SDK will try to extract the organization ID from the DSN. If it cannot be found, or if you need to override it,
you can provide the ID with this option. The organization ID is used for trace propagation and for features like `strictTraceContinuation`.

</SdkOption>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine. Or move it below DSN.

@s1gr1d s1gr1d requested review from Lms24 and codyde July 25, 2025 13:43
Copy link
Collaborator

@inventarSarah inventarSarah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! ☀️

I added a few suggestions (mostly the same because of the repeating content :) )

Comment on lines 396 to 403
<SdkOption name="orgId" type='`${number}` | number'>

The organization ID for your Sentry project.

The SDK will try to extract the organization ID from the DSN. If it cannot be found, or if you need to override it,
you can provide the ID with this option. The organization ID is used for trace propagation and for features like `strictTraceContinuation`.

</SdkOption>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree!
Here are my thoughts:
A more sustainable approach (for example, in the future, this ID could be used in other features?) might be to place it under "Core Options", under DSN. Then, to highlight that only specific features use this option, you could put the respective sentences ("The organization ID is used for ...") into an Alert (info). And then link orgId in the strictTraceContinuation option so users don't have to search for it.

The organization ID for your Sentry project.

The SDK will try to extract the organization ID from the DSN. If it cannot be found, or if you need to override it,
you can provide the ID with this option. The organization ID is used for trace propagation and for features like `strictTraceContinuation`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
you can provide the ID with this option. The organization ID is used for trace propagation and for features like `strictTraceContinuation`.
you can provide the ID with this option. The organization ID is used for trace propagation and features like `strictTraceContinuation`.

_Available since SDK version 10_

When your application receives requests, they might include `sentry-trace` and `baggage` headers from an upstream service that is also using Sentry.
By default, the SDK will continue the trace from the incoming headers. This can be undesirable if the requests are from a third-party service,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
By default, the SDK will continue the trace from the incoming headers. This can be undesirable if the requests are from a third-party service,
By default, the SDK will continue the trace from these incoming headers. However, this behavior can be undesirable if the requests are from a third-party service,

By default, the SDK will continue the trace from the incoming headers. This can be undesirable if the requests are from a third-party service,
as it can lead to unwanted traces, increased billing, and skewed performance data.

To prevent this, you can enable `strictTraceContinuation`. When this option is set to `true`, the SDK checks the incoming request for Sentry trace information.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To prevent this, you can enable `strictTraceContinuation`. When this option is set to `true`, the SDK checks the incoming request for Sentry trace information.
To prevent this, you can enable `strictTraceContinuation`. When this option is set to `true`, the SDK checks the incoming request for Sentry trace information and only continues the trace if it belongs to the same Sentry organization.

as it can lead to unwanted traces, increased billing, and skewed performance data.

To prevent this, you can enable `strictTraceContinuation`. When this option is set to `true`, the SDK checks the incoming request for Sentry trace information.
It only continues the trace if it belongs to the same Sentry organization. Otherwise, it starts a new trace.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It only continues the trace if it belongs to the same Sentry organization. Otherwise, it starts a new trace.
Otherwise, it starts a new trace.

@s1gr1d s1gr1d merged commit 8436336 into master Jul 29, 2025
13 checks passed
@s1gr1d s1gr1d deleted the sig/js-strictTraceContinuation branch July 29, 2025 12:07
lucas-zimerman pushed a commit that referenced this pull request Jul 29, 2025
## DESCRIBE YOUR PR

Docs for `strictTraceContinuation` and `orgId` ([related
PR](getsentry/sentry-javascript#16313)).

I'm not 100% sure where I should put the `orgId` as it does not 100% fit
into the "Tracing Options" section but it's currently only used for
tracing.

closes getsentry/sentry-javascript#16308

## IS YOUR CHANGE URGENT?  

Help us prioritize incoming PRs by letting us know when the change needs
to go live.
- [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE -->
- [ ] Other deadline: <!-- ENTER DATE HERE -->
- [ ] None: Not urgent, can wait up to 1 week+

## SLA

- Teamwork makes the dream work, so please add a reviewer to your PRs.
- Please give the docs team up to 1 week to review your PR unless you've
added an urgent due date to it.
Thanks in advance for your help!

## PRE-MERGE CHECKLIST

*Make sure you've checked the following before merging your changes:*

- [ ] Checked Vercel preview for correctness, including links
- [ ] PR was reviewed and approved by any necessary SMEs (subject matter
experts)
- [ ] PR was reviewed and approved by a member of the [Sentry docs
team](https://github.com/orgs/getsentry/teams/docs)
@github-actions github-actions bot locked and limited conversation to collaborators Aug 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document orgId and strictTraceContinuation
3 participants